package com.itheima.test5;

/**
 * @Author:gy
 * @Date: 2025/09/01 10:55
 * @Description:
 */
public class MyRunable implements Runnable {
    public MyRunable() {
    }
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            //线程休眠 睡一会  不释放cpu的执行权
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName()+"----"+i);
        }
    }
}
